package com.hmall.common.clients;



import com.hmall.common.config.DefaultFeignConfiguration;
import com.hmall.common.dto.PageDTO;
import com.hmall.common.dto.RequestParams;
import com.hmall.common.pojo.Address;
import com.hmall.common.pojo.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "itemservice",configuration = DefaultFeignConfiguration.class)
public interface ItemClients {
    @PostMapping("/item/list")
    PageDTO<Item> findAll(@RequestBody RequestParams requestParams);

    @GetMapping("/item/{id}")
    Item findById(@PathVariable Long id);


    @GetMapping("/item/stock/{itemId}/{num}")
    public void getStock(@PathVariable Long itemId,@PathVariable Integer num);

}
